<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    
    <title></title>
    
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
<script type="text/javascript" src="<%=basePath%>js/jquery-1.6.2.js"></script>
<script type="text/javascript">
$(document).ready(function(){


  $("#submit").click( function() {
  // 这里可以写些验证代码
   var valuetest=$("input[name='language']");
   
   //alert($(valuetest[1]).val());
   //valuetest.each(function(i){
   //alert($(this).val());
   //});
   var aa=[0,1,1,2,2,3];  
   var monthIncome = $.map($("input[name='language']"),function(obj){
            return $(obj).val();
   });
   var dataParam={"name":"john","choices[]":monthIncome};
   $.ajax({
   type: "get",
   url: "<%=basePath%>sell/aa.jsp",
   data: dataParam,
   success: function(msg){
     alert(msg);
   }
   });
  });
});
</script>
  </head>
  
<body>
<%
out.print("//////////////////////////////////");
String[] ss=request.getParameterValues("choices[]");
//out.print(ss);
//String aa=request.getParameter("choices[]");
//out.print(aa);
if(ss!=null){
for(int i=0;i<ss.length;i++){
out.print(ss[i]+"#");
}
}
out.print("//////////////////////////////////");
%>
<form action="<%=basePath%>sell/aa.jsp" method="get">
<input type="button" value="按钮" id="submit"/>
<input type="text" value="1" name="language"/>
<input type="text" value="2" name="language"/>
<input type="text" value="3" name="language"/>
<input type="text" value="4" name="language"/>
<input type="submit">
</form>
</body>
</html>
